<?php
/**
 * Created by PhpStorm.
 * User: woody
 * Date: 18-10-11
 * Time: 上午9:25
 */
namespace App\Models;

class  Qrcode {

    public function scerweima($url=""){
         include public_path('admin/libs/phpqrcode/phpqrcode.php');
         $value=$url;
        //$value = 'http://www.baidu.com';					//二维码内容
        $errorCorrectionLevel = 'L';	//容错级别
        $matrixPointSize = 5;			//生成图片大小
        //生成二维码图片
        $filename = './admin/img/'.microtime().'.png';

        $result=\QRcode::png($value,$filename , $errorCorrectionLevel, $matrixPointSize, 2);

        $filename="http://fitment.guoxiaoge.cn".substr($filename,1);

        return $filename;

       // echo "<img src='".$filename."'alt='使用微信扫描支付'>";

    }
//将推广码地址保存至数据库中
   public function saveData($data){
        return \DB::table('promotioncode')->insert($data);
   }


    }
